<template>
  <div>
    <FilterTable
      ref="table"
      columnsRef="ygy_repairProject"
      :columns="columns"
      :dataSource="roLaboursProject"
      height="auto"
      :isSelectColumn="false"
      :onColumnsChange="columns => (this.columns = columns)"
    ></FilterTable>

    <!-- 查看派工情况 -->
    <!-- <BaseDialog :visible.sync="action.visible" :title="action.title" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px', zIndex: '9999' }">
      <workerHistory :rowData="action.data" @close="closeWorker" :allUser="allUser" />
    </BaseDialog> -->
  </div>
</template>

<script>
export default {
  name: 'repairProject',
    props: {
    roLaboursProject: {
      type: Array,
      default: () => []
    },
  },
  data() {
    return {
      columns: this.createTableColumns(),
      list:[],
      roLabours:{},
      action: { title: '', visible: false, data: null },
      tableData: []
    };
  },
  created() {
    let roNo = this.roNo;
  },
  mounted() {
    this.queryAdditionaItem();
  },
  methods: {
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '收费区分',
          dataIndex: 'accountTypeName',
          sorter: true,
          dictItems: []
        },
        {
          title: '项目代码',
          dataIndex: 'labourCode',
          sorter: true
        },
        {
          title: '维修项目名称',
          dataIndex: 'labourName',
          width: 200,
          sorter: true,
          showOverflowTooltip: true
        },
        {
          title: '工时单价',
          dataIndex: 'labourPrice',
          sorter: true,
          precision: 2
        },
        {
          title: '标准工时',
          dataIndex: 'stdLabourHour',
          sorter: true,
          precision: 2
        },
        {
          title: '工时费',
          dataIndex: 'labourAmount',
          sorter: true,
          precision: 2
        },
        {
          title: '派工工时',
          dataIndex: 'assignLabourHour',
          sorter: true,
          precision: 2
        },
        // {
        //   title: '优惠金额',
        //   dataIndex: 'preferentialAmount',
        //   sorter: true,
        //   precision: 2
        // },
        {
          title: '折扣率',
          dataIndex: 'discount',
          sorter: true,
          precision: 2
        },
        // {
        //   title: '实收金额',
        //   dataIndex: 'receiveAmount',
        //   sorter: true,
        //   precision: 2
        // },
        {
          title: '活动编号',
          dataIndex: 'activityCode',
          sorter: true,
          // render: props => {
          //   return <span>{props.row.activityCode == 'null' ? (props.row.activityCode = '') : props.row.activityCode}</span>;
          // }
        },
      ];
    },

    // 附加材料查询
    async queryAdditionaItem() {
      console.log(JSON.stringify(this.roLaboursProject)+"--------------------------------------")
    },

    closeWorker() {
      this.action.visible = false;
    }
  }
};
</script>

<style lang="less"></style>
